package com.example.demo.controller;

import com.example.demo.entity.basicquery;
import com.example.demo.entity.deletebasic;
import com.example.demo.entity.fnameview;
import com.example.demo.service.QuerymanageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("quer")
@CrossOrigin//允许跨域
@Api(tags= "查询管理操作类",value = "查询相关操作类")
public class Querymanage {
    @Resource
    QuerymanageService QuerymanageService;

    @PostMapping("/fname")
    @ApiOperation(value ="根据故障名称查询",notes= "可根据故障名称查询故障停机时间、维修时间、发电量损失（kWh）")
    public List fnameview(@RequestBody fnameview fnameview)
    {return QuerymanageService.fnameview(fnameview);}

    @PostMapping("/basicquery")
    @ApiOperation(value ="根据机组编号查询",notes= "根据机组编号查询机组发电量、全场发电量,查询设备的运行状况,备件消耗等情况")
    public List basicquery(@RequestBody deletebasic deletebasic)
    {
        return QuerymanageService.basicquery(deletebasic);
    }

    @PostMapping("/faultnumquery")
    @ApiOperation(value ="故障统计",notes= "返回故障统计情况")
    public List faultnumquery()
    {
        return QuerymanageService.faultnumquery();
    }


}
